<form action="index.php?page=search" method="post">
<?php include("menucontenttop.php");?><br/>
<span class="sp_home_title">Nhập vào tài liệu cần tìm kiếm</span> : <br/> <br/>
<table border="0" cellpadding="0" cellspacing="0" style="padding-left:10px;">
	<tr>
		<td><input size="40" type="text" name="keyword" /></td>
		<td><input type="submit" name="submit" value="Tìm kiếm" /></td>
	</tr>
</table>
<?php
	$kw = $_POST['keyword'];
	if(isset($_POST["submit"])){
	if($kw==""){
		echo "Bạn phải nhập vào chuỗi tìm kiếm!";
	}else{?>
	<?php
	$i=1;
	$query = "SELECT * FROM productdetails WHERE productname LIKE '%$kw%'";
	$result = mysql_query($query);
	while($row = mysql_fetch_array($result))
	{?>
	<div class="sp_moi_content">		
		<div class="khung_sp_tc_main">
			<table width="100%" cellspacing="0" cellpadding="0" border="0">
			
				<tr>
					<td width="100%" class="content-box">
						<div align="left"><a href="index.php?page=listviewproductDetail&id=<?php echo $row['id'];?>"><?php echo $row['productname'];?></a></div>
					</td>
				</tr>
				<tr>
					<td width="100%" class="content-second"><?php echo $row['productDetail'];?></td>
				</tr>
			</table>
		</div>
	</div>
<?php
		}
	}
}
?>
</form>